﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace COFE.Core.Tasks
{
    public enum ProgressType { Start, Progress, Success, Error }

    public class TaskProgressEventArgs : EventArgs
    {
        

        #region Constructor
        public TaskProgressEventArgs(ProgressType progressType, string message, int total, int progress)
        {
            //ParentTaskId = COFETaskShared.ParentTaskId;
            //TaskStage = COFETaskShared.TaskStage;
            Message = message;
            ProgressType = progressType;
            Total = total;
            Progress = progress;           
        }

        public TaskProgressEventArgs(ProgressType progressType)
            : this(progressType, null, -1, -1)
        {

        }

        public TaskProgressEventArgs(int total, int progrss)
            : this(ProgressType.Progress, null, -1, -1)
        {

        }


        #endregion

        #region Methods

        #endregion

        #region Data

        #endregion

        #region Public Properties

        public Guid ParentTaskId { get; private set; }
        public int TaskStage { get; private set; }
        public ProgressType ProgressType { get; private set; }
        public int Total { get; private set; }
        public int Progress { get; private set; }
        public int PercentCompleted { get { return (int)Math.Ceiling((float)Progress / (float)Total * 100.0); } }
        public string Message { get; private set; }

        #endregion

    }
}
